#!/bin/bash
CPU_COUNT=`cat /proc/cpuinfo | grep processor | wc -l`

MEM_OPTS="-Xms1024m -Xmx1024m -XX:PermSize=64m -server"

GC_OPTS="-XX:ParallelGCThreads=$CPU_COUNT -XX:SurvivorRatio=1  -XX:-UseAdaptiveSizePolicy -XX:+CMSClassUnloadingEnabled -XX:CMSInitiatingOccupancyFraction=80 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -Xloggc:logs/gc.log"


echo "JMX参数: "$JMX_OPTS
echo "内存参数: "$MEM_OPTS
echo "垃圾收集参数: "$GC_OPTS
# 打印到startup.log
if [ ! -d logs ]; then  mkdir logs  ; fi 
java $MEM_OPTS -jar lib/mxdx_edu_web-1.0.0-SNAPSHOT.jar --spring.config.name=application  >> logs/start.out 2>&1 &

pid=$!
echo $pid>.pid
echo "qb_demo_server 启动成功"
